*-------------------------------------------------------------------------------------------------------*
*RESEARCHERS:		Mette Foged, Linea Hasager and Vasil Yasenov
*PROJECT:			Meta-analysis
*DESCRIPTION:		1  Load database
*					2  Create correlation matrix
*-------------------------------------------------------------------------------------------------------*
*ssc install binscatter
*ssc install coefplot

clear all
set more off


use "${data}\OECD_panel_countries_used.dta", replace


*-------------------------------------------------------------------------------------------------------*
*-------------------------------------------------------------------------------------------------------*

label var StrictEmpInd "\emph{EPL (Regular)}"
label var StrictEmpColl "\emph{EPL (Collective)}"
label var StrictEmpTemp "\emph{EPL (Temporary)}"
label var AverageTenure "\emph{Average Job Tenure}"
label var CollBarg "\emph{Collective Bargaining}"
label var PMR "\emph{Product Market Regulation}"
label var NetReplacementRate "\emph{Net Replacement Rate}"

*Correlation matrix, all institutional variables
correlate AverageTenure-NetReplacementRate
*Correlation matrix, our main institutional variables
eststo clear
estpost correlate AverageTenure-NetReplacementRate, matrix
eststo correlation1
esttab correlation1 using "$out\table_correlations_all.rtf", replace b(2) unstack compress



*Correlation matrix, our main institutional variables
eststo clear
estpost correlate StrictEmpInd StrictEmpColl AverageTenure CollBarg NetReplacementRate, matrix
eststo correlation
esttab correlation using "$out\table_correlations.tex", replace b(2) nonotes /*nostar*/ star(* 0.10 ** 0.05 *** 0.01) nolines not noobs nogaps nonum label booktabs unstack compress ///
 prehead("\begin{tabular}{l*{5}{c}} \toprule &  (1) & (2) &  (3)  & (4)  & (5) \\ ") posthead("\midrule") postfoot("\bottomrule \end{tabular}") mlabels(none)


 
*Correlation matrix, our main institutional variables and robustness checks
correlate StrictEmpInd StrictEmpColl StrictEmpTemp AverageTenure CollBarg NetReplacementRate PMR StateControl BTE BTTI
